package com.haier.cloudremote;

import java.util.ArrayList;
import java.util.List;

import android.app.Activity;

import com.haier.cloudremote.protocal.CAEProtocal;

public class ActivityStackControlUtil {
	
	private static List<Activity> activityList = new ArrayList<Activity>(); 
    
    public static void remove(Activity activity){ 
         
        activityList.remove(activity); 
         
    } 
      
    public static void add(Activity activity){ 
         
        activityList.add(activity); 
         
    } 
     
    public static void finishProgram() { 
 
        for (Activity activity : activityList) { 
             
            activity.finish(); 
             
        } 
         
        android.os.Process.killProcess(android.os.Process.myPid()); 
        int debugReturn = CAEProtocal.switchOfDebug(0);
 
    } 
}
